package models

type Article struct {
	Id          int64  `gorm:"column:id; primaryKey, autoIncrement"`
	ArticleId   int64  `gorm:"column:article_id; unique"`
	AuthorId    int64  `gorm:"column:author_id;"`
	CommunityId int64  `gorm:"column:community_id;"`
	CreateTime  int64  `gorm:"column:create_time"`
	UpdateTime  int64  `gorm:"column:update_time"`
	Status      int8   `gorm:"column:status;"`
	Title       string `gorm:"column:title; varchar(64)"`
	Content     string `gorm:"column:content;"`
}

type PostArticle struct {
	AuthorId    int64  `json:"author_id"`
	CommunityId int64  `json:"community_id" binding:"required"`
	Status      int8   `json:"status"`
	Title       string `json:"title" binding:"required"`
	Content     string `json:"content" binding:"required"`
}

type ApiArticleDetail struct {
	AuthorName string `json:"author_name"`
	*Article `json:"article"`
	*Community `json:"community"`
}
